package com.blindbugs.boletus;

import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;

public class BoletusMap extends MapActivity  {
	SQLiteDatabase db;
	BoletusSQLiteHelper boletusSQL;
	boolean isToolbarVisible=false;
    @Override 
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.map);
        MapView mapView = (MapView) findViewById(R.id.mapView);
        
        mapView.setSatellite(false);
    
//       
//        List<Overlay> mapOverlays = mapView.getOverlays();
//        
//        
//        Drawable drawable = this.getResources().getDrawable(R.drawable.marker);
//        BoletusItemizedOverlay itemizedoverlay = new BoletusItemizedOverlay(drawable,this);
//        
//        
        //animateToolbar(isToolbarVisible);
        
        //ImageView toolbarButton = (ImageView) this.findViewById(R.id.toolbarButton)	;
       // toolbarButton.setOnClickListener(this);
        
        
        
        
        //boletusSQL=new BoletusSQLiteHelper(this, "boletus", null, 1);
       
       // db= boletusSQL.getReadableDatabase();
        //BoletusActionOverlay o=new BoletusActionOverlay();
        //o.setOnMapTouchListener(this);
       // Cursor c=boletusSQL.getFindings(db);
//        
//        if (c.moveToFirst())
//        {
//        	do
//        	{
//        
//		        GeoPoint point = new GeoPoint(c.getInt(c.getColumnIndex("latitude")),
//		        							  c.getInt(c.getColumnIndex("longitude")));
//		        OverlayItem overlayitem = new OverlayItem(point, "Boletus!",c.getString(c.getColumnIndex("description")));
//		        itemizedoverlay.addOverlay(overlayitem);
//        	} while (c.moveToNext());
//        }
       
        //mapOverlays.add(itemizedoverlay);
       // mapOverlays.add(o);
        
    }
    
    @Override
    protected boolean isRouteDisplayed() 
    {
        return false;
    }
//
//	@Override
//	public void OnMapTouch(GeoPoint point) {
//		MapView mv=(MapView) findViewById(R.id.mapView);
//        OverlayItem overlayitem = new OverlayItem(point, "Boletus!","butto");
//
//		((BoletusItemizedOverlay) (mv.getOverlays().get(0))).addOverlay(overlayitem);
//
//		
//	}

//	private void animateToolbar(boolean up)
//	{
//		 LinearLayout toolbarLayout = (LinearLayout) this.findViewById(R.id.toolbarLayout);
//		 LinearLayout toolbarBody = (LinearLayout) this.findViewById(R.id.toolbarBody);
//		 float startValue=0, endValue=-1f;
//		 if (up)
//			 endValue=0.5f;
//		 else	
//			 startValue=0.5f;
//		 toolbarBody.setVisibility((up)?LinearLayout.VISIBLE:LinearLayout.GONE);
//		 TranslateAnimation anim=new TranslateAnimation(TranslateAnimation.RELATIVE_TO_SELF, 0, TranslateAnimation.RELATIVE_TO_SELF, 0, TranslateAnimation.RELATIVE_TO_SELF, startValue, TranslateAnimation.RELATIVE_TO_SELF, endValue);
//		 anim.setDuration(500);
//		 anim.setFillAfter(true);
//	     toolbarLayout.startAnimation(anim);	
//	}

//	@Override
//	public void onClick(View arg0)
//	{
//		isToolbarVisible=!isToolbarVisible;
//		animateToolbar(isToolbarVisible);
//		
//	}
	
}